{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import json\n",
    "from utils.utils import save_json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "count = {c:0 for c in range(10)}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "paths = ['data/train.csv', 'data/test.csv']\n",
    "for path in paths:\n",
    "    df = pd.read_csv(path)\n",
    "    for i in range(df.shape[0]):\n",
    "        count[df.iloc[i,0]] += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "count2 = {f'Class_{c}': n for c,n in count.items()}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "save_json(count2,'num_class.json')"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "96425d339b0e6107dbb91cb157c2db64734def97b9748c3a4592256fc09ea454"
  },
  "kernelspec": {
   "display_name": "Python 3.6.13 ('pypots')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
